package com.anxinr.service.impl;

import com.anxinr.mapper.GoodsMapper;
import com.anxinr.pojo.entity.Goods;
import com.anxinr.service.IGoodsService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author anxinr
 */
@Service
public class IGoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
    @Override
    public Page<Goods> queryUsers(Goods goods) {
        Page<Goods> page = new Page<>(goods.getPage(), goods.getSize());
        LambdaQueryWrapper<Goods> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(goods.getIname()),Goods::getIname,goods.getIname());
        return this.page(page,wrapper);
    }
}
